﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Buddy.CommonBot;


namespace WingIt
{
    [RevisionControlId("$Id: NamedThrottle.cs 684 2012-08-08 10:09:07Z Chinajade $")]
    public class Throttle
    {
        public Throttle(string name)
        {
            _name = name;
        }


        /// <summary>
        /// <para>Returns true, if the throttle identified by THROTTLENAME is ready to be used.</para>
        /// <para>Notes:<list type="bullet">
        /// <item><description><para> * If the throttle has never been used (e.g., first time), then it is deemed ready (true is returned).</para></description></item>
        /// <item><description><para> * A throttle is 'not ready' until its cooldown time has elapsed since the last call to <c>NamedThrottle.Used()</c>.</para></description></item>
        /// </list></para>
        /// </summary>
        /// <param name="ability"></param>
        /// <returns></returns>
        ///  7Jul2012-21:11UTC chinajade
        public virtual bool  IsReady();


        /// <summary>
        /// <para>Marks the throttle identifid by THROTTLENAME as 'not ready', until the COOLDOWNTIME expires.</para>
        /// <para>Notes:<list type="bullet">
        /// <item><description><para> * If the throttle has never been used (e.g., first time), this method automatically creates it.</para></description></item>
        /// <item><description><para> * Once this method is called, a throttle is 'not ready' until its cooldown time has elapsed.</para></description></item>
        /// </list></para>
        /// </summary>
        /// <param name="ability"></param>
        ///  7Jul2012-21:11UTC chinajade
        public virtual void Used(TimeSpan cooldownTime);


        protected string _name;
    }
}
